package org.apache.ocean;

import org.apache.commons.lang.builder.*;

/**
 *
 * @author jasonr
 */
public class HostPort {
  public String host;
  public int port;
  
  public HostPort(String host, int port) {
    this.host = host;
    this.port = port;
  }
  
  public boolean equals(Object object) {
    if (!(object instanceof HostPort)) return false;
    if (object == null) return false;
    HostPort other = (HostPort)object;
    EqualsBuilder equalsBuilder = new EqualsBuilder();
    equalsBuilder.append(host, other.host);
    equalsBuilder.append(port, other.port);
    return equalsBuilder.isEquals();
  }
  
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder(105, 7);
    builder.append(host);
    builder.append(port);
    return builder.toHashCode();
  }
}
